﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>知识库</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <script src="components/requirejs/require.js" async="async" data-main="resources/js/knowledge"></script>
    <link href="resources/css/common.css" rel="stylesheet" />
    <link href="resources/css/knowledge.css" rel="stylesheet" />
</head>
<body>
    <div id="view">
        <div view v-if="isloading"></div>

        <div query>
            <div>
                <div center-v>
                    <input type="text" placeholder="请输入你要查询的知识关键字" v-model="keyword" />
                </div>
                <div center v-on:click="query">
                    <img src="resources/image/common/search.png" />
                </div>
            </div>
            <div center v-on:click="gotoPublish">
                <img src="resources/image/knowledge/publish.png" />
            </div>
        </div>

        <div bar>
            <div center v-on:click="gotoList('标准化知识')">
                <img src="resources/image/knowledge/learning.png" />
                <div>
                    知识学习
                </div>
            </div>
            <div center v-on:click="gotoList('问题求助')">
                <img src="resources/image/knowledge/commonProblem.png" />
                <div>
                    问题求助
                </div>
            </div>
        </div>

        <div v-if="!isQuery">
            <div group v-if="warn.length > 0">
                <div group-title>
                    <div>
                        热门知识
                    </div>
                    <div center>
                        <div arrow-up></div>
                    </div>
                </div>
                <div group-item v-for="item in warn" v-on:click="gotoDetail(item.id)">
                    <div>
                        <div>
                            {{item.title}}
                        </div>
                        <div>
                            {{item.publish_date}}
                        </div>
                    </div>
                    <div center>
                        <img src="resources/image/common/entry.png" />
                    </div>
                </div>
            </div>

            <div group v-if="newKnowledge.length > 0">
                <div group-title>
                    <div>
                        最新知识
                    </div>
                    <div center>
                        <div arrow-up></div>
                    </div>
                </div>
                <div group-item v-for="item in newKnowledge" v-on:click="gotoDetail(item.id)">
                    <div>
                        <div>
                            {{item.title}}
                        </div>
                        <div>
                            {{item.publish_date}}
                        </div>
                    </div>
                    <div center>
                        <img src="resources/image/common/entry.png" />
                    </div>
                </div>
            </div>
        </div>

        <div v-if="isQuery" result v-for="item in result" v-on:click="gotoDetail(item.id)">
            <div>
                <div>
                    {{item.title}}
                </div>
                <div>
                    {{item.publish_date}}
                </div>
            </div>
            <div center>
                <img src="resources/image/common/entry.png" />
            </div>
        </div>

        <div empty v-if="(!isQuery && warn.length == 0 && newKnowledge.length == 0) || (isQuery && result.length == 0)">
            <img src="resources/image/common/empty.png" />
            <div>暂无数据</div>
        </div>
    </div>
</body>
</html>